<?php
/* 2011-11-17 */
header("Content-type: text/html; charset=utf-8");
$storage = new CEStorage(); 
if($_POST){
	//$attach['tmp_name']

	if($storage->upload($_FILES['attach']['tmp_name'],"123.jpg")){
		echo '成功'.$storage->getUrl('123.jpg');
	}else{
		echo '失败'.$storage->errmsg();
		//echo $storage->errno();
	}
	
	
	
}else{
	$fileList = $storage->getList();
	print_r($fileList);
	//echo $storage->getUrl("123.jpg");
//	if($storage->fileExists("syntaxHighlighter.zip")){
//		$storage->delete("syntaxHighlighter.zip");
//		echo '成功';
//	}else{
//		echo '失败';
//	}
	
//	if(file_put_contents('1.htm', '1234567899')){
//		echo '成功';
//	}else{
//		echo '失败';
//	}
	
	$file = new CeFile();
	$str = '行者舞林html静态化测试';
	if($file->write("1.html",$str,0)){
		echo '成功';
	}else{
		echo '失败';
	}

	 
	
	
}



?>

<form enctype="multipart/form-data" method="post" action="up.php">

	<input type="file" name="attach">
	<input type="submit" name="html-upload" value="上传" >

</form>
<img src="/aliyun_ce_storage/123.jpg">